<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>课程编辑</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="button/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="button/css/vicons-font.css" />
<link rel="stylesheet" type="text/css" href="button/css/base.css" />
<link rel="stylesheet" type="text/css" href="button/css/buttons.css" />
<style type="text/css"> 
	.ccc{
		margin:auto;
		width: 300px;
		height: 200px;
		padding: 20px;
	}
	form p label{
	display: inline-block;
	width: 120px;
	text-align: right;
	margin: 10px auto;
}
	input {
	padding: 6px;
}
	form  button{
		float: right;
}	
	body { 
	height: 700px;
 	background-image: linear-gradient(45deg, #00FFFF , #FFC0CB 60%); 
	margin: 0;
	padding: 0;
	}
 

</style>
<script type="text/javascript">
	function aaa(from){
		var name=from.name.value;
		var classHour=from.classHour.value;
		 var reg = /^[1-9]\d*$/;
		if(name.length==0){
			alert("课程名称必填");
			return false;
		}
		if(classHour.length==0){
			alert("课时必填");
			return false;
		}
		if(!reg.test(classHour)){
			alert("课时必须为正整数");
			return false;
		}
		return true;
	}
	function course() {
		window.location="course"
	}	
</script>
</head>
<body>
	<div class="ccc">
	<form action="course?method=save" method="post" onsubmit="return aaa(this)">
		<input type="hidden"  name="id" value="${model.id }">
		<p><label>课程名称：</label><input type="text" name="name" value="${model.name}"></p>
		<p><label>课时：</label><input type="text" name="classHour" value="${model.classHour}"></p>
		<p>
		<button type="submit" class="button button--saqui button--inverted button--border-thin button--round-s" data-text="提交">提交</button>
      	<button type="reset" class="button button--saqui button--inverted button--border-thin button--round-s" data-text="重置">重置</button>
		<button onclick="course()" class="button button--wapasha button--round-s">返回</button></p>
	</form>		
	</div>
	
</body>
</html>